module(..., package.seeall)

require "myUiWin"

PAGEID = 0

local backColor = 0x0000

function initPage()
    local width, data = qrencode.encode("GWEV_" .. misc.getImei())
    local displayWidth = 70

    disp.setcolor(0xFFFF)
    disp.setbkcolor(backColor)
    disp.clear()
    disp.drawrect(0, 22, 105, 23, 0x017E)
    disp.drawrect(110, 22, 160, 23, 0x06C0)
    disp.puttext(common.utf8ToGb2312("请扫描二维码绑定"), 2, 2)
    disp.putqrcode(data, width, displayWidth, 55, 35)
    disp.puttext("GWEV_" .. misc.getImei(), ui_handle.getXPos("GWEV_" .. misc.getImei()), 95)
    disp.update()
end

function refresh()

end

function onKey(value)
    if value == "return" or value == "down" then
        myUiWin.openWin(ui_index.PAGEID, 1)
    end
end